<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/6
 * Time: 10:27
 */

if(empty($_POST['username'])){
    echo '用户名为空!!!';
    echo '<a href="Login.php">返回登录页面</a>';
    die;
}
if(empty($_POST['password'])){
    echo '密码为空!!!';
    echo '<a href="Login.php">返回登录页面</a>';
    die;
}

$username = $_POST['username'];
$password = $_POST['password'];

print_r($_POST);

if($username=='admin'&&$password=='888888'){
    echo '<h1>用户中心</h1>';
    echo '<a href="userCenter.php">点击进入用户中心</a>';
    $Token = md5($username.$password.time());
    setcookie('Token',$Token,time()+24*3600);
    echo '<br />';
    echo '<button><a href="Login.php">退出登录</a></button>';
}else{
    echo '用户名或密码错误，请重新输入!!!';
    echo '<a href="Login.php">返回登录页面</a>';
}